package com.ms3ds.mineInfo.api;

import com.ms3ds.common.core.constant.ServiceNameConstants;
import com.ms3ds.common.core.domain.R;
import com.ms3ds.mineInfo.api.domain.Team;
import com.ms3ds.mineInfo.api.domain.Worker;
import com.ms3ds.mineInfo.api.factory.RemoteMineFallbackFactory;
import com.ms3ds.mineInfo.api.factory.RemoteWorkerFallbackFactory;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;

/**
 * 矿山信息服务
 * 
 * @author zlw
 */
@FeignClient(contextId = "remoteWorkerService", value = ServiceNameConstants.MINEINFO_SERVICE, fallbackFactory = RemoteWorkerFallbackFactory.class)
public interface RemoteWorkerService
{

    /**
     * 获取矿山下的生产队信息
     * @return
     */
    @GetMapping("/worker/getWorkerByTeamIdForRemote")
    R<List<Worker>> getWorkerByTeamIdForRemote(@RequestParam("teamId") Long teamId);

    /**
     * 编辑工人信息
     * @param worker
     * @return
     */
    @PutMapping("/worker/editWorkerForRemote")
    R<Boolean> editWorkerForRemote(@RequestBody Worker worker);

}
